runtime! debian.vim

" Vim5 and later versions support syntax highlighting. Uncommenting the next
" line enables syntax highlighting by default.
if has("syntax")
  syntax on
endif

" If using a dark background within the editing area and syntax highlighting
" turn on this option as well
"set background=dark

" Uncomment the following to have Vim jump to the last position when
" reopening a file
"if has("autocmd")
"  au BufReadPost * if line("'\"") > 1 && line("'\"") <= line("$") | exe "normal! g'\"" | endif
"endif

" Uncomment the following to have Vim load indentation rules and plugins
" according to the detected filetype.
"if has("autocmd")
"  filetype plugin indent on
"endif

" The following are commented out as they cause vim to behave a lot
" differently from regular Vi. They are highly recommended though.
"set showcmd		" Show (partial) command in status line.
"set showmatch		" Show matching brackets.
"set ignorecase		" Do case insensitive matching
"set smartcase		" Do smart case matching
"set incsearch		" Incremental search
"set autowrite		" Automatically save before commands like :next and :make
"set hidden		" Hide buffers when they are abandoned
"set mouse=a		" Enable mouse usage (all modes)

" Source a global configuration file if available
"if filereadable("/etc/vim/vimrc.local")
"  source /etc/vim/vimrc.local
"endif

"设置VI兼容性  compatible/nocompatible 兼容/不兼容
set nocompatible
"设置backspace的工作方式
set backspace=indent,eol,start

"WIN32下设置窗口大小
"if has('win32')
"    set lines=30 columns=180
"endif

"设置工作目录为当前编辑文件的目录
set bsdir=buffer
"set autochdir
"编码集设置
set enc=utf-8
set encoding=utf-8
set fencs=utf-8,ucs-bom,shift-jis,gb18030,gbk,gb2312,cp936
"语言设置
set langmenu=zh_CN.UTF-8
"language message zh_CN.UTF-8
set helplang=cn
if has('win32')
    source $VIMRUNTIME/delmenu.vim
    source $VIMRUNTIME/menu.vim
endif
"关闭自动补全会自动打开scratch预览
set completeopt=menu
" 设置单行长度提示线
set colorcolumn=121
"总是显示状态栏
set laststatus=2
"显示光标当前位置
set ruler
"高亮当前行、列
"set cursorline
"set cursorcolumn
"上面配置高亮非常刺眼，需要美化(detorte配置失败了，有精力劲量把detorte配置好)
"highlight CursorLine cterm=NONE ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE
"highlight CursorColumn cterm=NONE ctermbg=NONE ctermfg=NONE guibg=NONE guifg=NONE
"高亮搜索结果
set hlsearch
"禁止拆行
set nowrap
"显示行号
set nu
"设置tab宽度4
set tabstop=4
"编辑模式按退格退回缩进长度
set softtabstop=4
"每一级缩进长度
set shiftwidth=4
"tab自动转空格 noexpandtab/expandtab
set expandtab
"自动缩进：每行的缩进值和上一行相等 noautoindent autoindent
set autoindent
"文件变化后自动变更
set autoread
"切换文件时自动保存
set autowriteall
"设置C/C++自动缩进方式
set cindent
"设置C/C++语言具体缩进方式
set cinoptions={0,1s,t0,n-2,p2s,(03s,=.5s,>1s,=1s,:1s
"设置bundle路径和bundle管理器vundle路径
if has('win32')
    set rtp+=$VIM/bundle/vundle/
    call vundle#rc('$VIM/bundle/')
else
    set rtp+=~/.vim/bundle/vundle/
    call vundle#rc('~/.vim/bundle/')
endif

"平台特殊配置
if has('win32')
	set pythonthreedll=python37.dll
endif

"针对Python3的特殊配置
if has('python3')
	silent! python3 1
endif

"""""""""""""""""""""""""""""""""""""""""""""""""""插件列表
"vundle自身：bundle管理器
Bundle 'gmarik/vundle'
"配色
"Bundle 'altercation/vim-colors-solarized'
"需要8.0支持，当前版本无法使用，直接禁用
"fatih/vim-go：golang支持
"Bundle 'fatih/vim-go'
"自动补全神器
"内存吃的太厉害1g内存，编译都成问题，也不指望跑了，直接注释了
"在1G内存的VM虚拟机下完成编译了，说明还是能编译的，，，最后还是熬了几天编译出来了
Bundle 'Valloric/YouCompleteMe'
"YCM官网推荐的能自动生成ycm配置的工具
Bundle 'rdnetto/YCM-Generator'
"coc.nvim vscode-like-language-server: 依赖node类似vscode的自动补全插件
"Plug 'neoclide/coc.nvim', {'branch': 'release'}
"taglist配合ctags使用
Bundle 'taglist.vim'
"更加适合C++的taglist(tagbar)
Bundle 'tagbar'
"自动更新ctags
"Bundle 'ludovicchabant/vim-gutentags'
"tab提示线(比较弱鸡，暂时不用了)
"Bundle 'nathanaelkane/vim-indent-guides'
"空格显示+tab提示线
Bundle 'Yggdroot/indentLine'
"窗口管理器
Bundle 'winmanager'
"快速切换文件
Bundle 'bufexplorer.zip'
"用于浏览文件系统的树形资源管理器
Bundle 'scrooloose/nerdtree'
"配色优化工具(没有生效)
"Bundle 'tamlok/detorte'
"cmake官方提供的 vim-cmake-syntax
Bundle 'pboettch/vim-cmake-syntax'
"protobuf语法高亮
Bundle 'uarun/vim-protobuf'
"Doxygen风格注释工具
Bundle 'DoxygenToolkit.vim'
"状态条加强
Bundle 'bling/vim-airline'
"文件跳转：
Bundle 'kien/ctrlp.vim'
"vim中运行shell    
":ConqueTerm {cmd}开启控制台。cmd可以bash python mysql等等
Bundle 'oplatek/Conque-Shell'
"vim中加强gdb支持 配置失败
"Bundle 'vim-scripts/Conque-GDB'
"自动代码注释/解开注释   \cc \cu
Bundle 'scrooloose/nerdcommenter'
" 文件内容搜索   :CtrlSF tar
Bundle 'dyng/ctrlsf.vim'
" svn/git/hg等插件支持
Bundle 'juneedahamed/vc.vim'
"主题
Bundle 'dracula/vim'
"git airblade/vim-gitgutter
"内容搜索, 目前还不能通过包管理安装，暂时不用
"Bundle 'rking/ag.vim'
"PHP智能补全(尝试失败，直接用ycm自带的omni算球 c+x c+o弹出补全 c+]跳转定义，需要先使用ctags -R生成tag)
"Bundle 'lvht/phpcd.vim'
"美化工具(没有生效)
"Bundle 'powerline/powerline'
"代码自动格式化插件
"Bundle 'rhysd/vim-clang-format'
"javadoc自动注释工具（alt-c for commenting the file/methods/attributes/classes）
"Bundle 'jcommenter.vim'
"""""""""" lua支持 """""""""
"有异常暂时不知道怎么处理
"Bundle 'vim-scripts/luainspect.vim'
Bundle 'xolox/vim-misc'
Bundle 'xolox/vim-lua-ftplugin'
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"set tags=./tags;tags

"""""""""""""""vim-gutentags配置""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let g:gutentags_trace=1
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""taglist配置""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
let Tlist_Ctags_Cmd='ctags'
let Tlist_Show_One_File=1     "不同时显示多个文件tag，只显示当前文件的
let Tlist_WinWidt=36          "设置taglist宽度
let Tlist_Exit_OnlyWindow=0   "如果taglist窗口是最后一个窗口，则退出vim(目前设置1会导致崩溃)
"let Tlist_Use_Right_Window=1  "在右边显示taglist窗口
let Tlist_UseLeft_Windo=1     "taglist窗口显示在左边
"map <F3> :Tlist<CR>           
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""tagbar配置""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
"开启tarbar的快捷键映射
"使用help <Leader>可以查看含义，据说是\; 映射生效后:/tb就会打开tarbar
"map <Leader>tb :TagbarToggle<CR>  
"/\都是用来搜索的，反正tagbar可以替代taglist，就直接把f3绑定到tagbar
map <F3> :TagbarToggle<CR>
if has('win32')
    let g:tagbar_ctags_bin='$VIM/other_bin/ctags'
else 
    "let g:tagbar_ctags_bin='/usr/bin/ctags'    "设置ctags文件路径，如果ctags在path下面，应该是可以忽略的
endif
let g:tagbar_width=36                      "设置默认宽度
let g:tagbar_left=1                        "设置显示在左边
autocmd BufReadPost *.c,*.h,*.hh,*.cc,*.hpp,*.cxx call tagbar#autoopen()   "识别到c/c++文件时，自动打开tagbar
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""NERDTree配置""""""""""""""""""""""""
let NERDTreeWinPos='right'     "在右边显示
let NERDTreeWinSize=33         "buffer宽度
let NERDTreeAutoCenter=0       "自动居中 
let NERDTreeShowBookmarks=1    "显示书签
let g:NERDTreeNodeDelimiter = "\u00a0"   "移除列表中显示的多余 ^G
"绑定快捷键
map <F2> :NERDTreeToggle<CR>   
"窗口跳转映射
nnoremap <C-J> <C-W><C-J>
nnoremap <C-K> <C-W><C-K>
nnoremap <C-L> <C-W><C-L>
nnoremap <C-H> <C-W><C-H>
""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""Powerline配置""""""""""""""""""""""
"let g:Powerline_colorscheme='solarized256'
""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""detorte配置""""""""""""""""""""""""
"let g:detorte_theme_mode='dark'
"source ~/.vim/bundle/detorte/colors/detorte.vim
"colorscheme detorte
"let g:detorte_theme_mode = 'dark'
"""""""""""""""""""""""""""""""""""""""""""""""""

""""""""""""""solarized配色"""""""""""""""""""""""
"syntax enable
"set background=dark
"colorscheme solarized
""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""vim-clang-format配置"""""""""""""""
"let g:clang_format#auto_format=1
"let g:clang_format#auto_format_on_insert_leave=1
""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""YouCompleteMe配置""""""""""""""""""
let g:ycm_confirm_extra_conf=0
let g:syntastic_enable_highlighting=0
"关闭这些文件类型的YCM支持
let g:ycm_filetype_blacklist = {
      \ 'php' : 1,
      \ 'tagbar' : 1,
      \ 'qf' : 1,
      \ 'notes' : 1,
      \ 'markdown' : 1,
      \ 'unite' : 1,
      \ 'text' : 1,
      \ 'vimwiki' : 1,
      \ 'gitcommit' : 1,
      \}
" 补全功能在注释中同样有效                                         
let g:ycm_complete_in_comments=1 
" 开启tags补全引擎                                                 
"let g:ycm_collect_identifiers_from_tags_files=1 
" 键入第一个字符时就开始列出匹配项                                 
"let g:ycm_min_num_of_chars_for_completion=1 
" YCM相关快捷键，分别是\gl, \gf, \gg    (esc模式下直接输入\gf，个人感觉这样不太方便，学习自定义命令后改掉)
nnoremap <leader>gl :YcmCompleter GoToDeclaration<CR>              
nnoremap <leader>gf :YcmCompleter GoToDefinition<CR>               
nnoremap <leader>gg :YcmCompleter GoToDefinitionElseDeclaration<CR>
" 强制刷新编译错误
nnoremap <leader>fc :YcmForceCompileAndDiagnostics<CR> 
" 显示编译错误列表
nnoremap <leader>se ::YcmDiags<CR> 
" win32特殊配置
if has('win32')
	" 关闭语法提示
	let g:ycm_show_diagnostics_ui = 0 
endif
"autocmd FileType python set omnifunc=pythoncomplete#Complete
"autocmd FileType javascript set omnifunc=javascriptcomplete#CompleteJS
"autocmd FileType html set omnifunc=htmlcomplete#CompleteTags
"autocmd FileType css set omnifunc=csscomplete#CompleteCSS
"autocmd FileType xml set omnifunc=xmlcomplete#CompleteTags
"开启基于omni的php智能补全 依赖 ctags -R
autocmd FileType php set omnifunc=phpcomplete#CompletePHP
"let php_sql_query=1
"let php_htmlInStrings=1
"autocmd FileType c set omnifunc=ccomplete#Complete
""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""vim-indent-guides配置""""""""""""""""""
let g:indent_guides_enable_on_vim_startup = 1
""""""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""indentLine""""""""""""""""""""""""""""
let g:indentLine_enabled = 1
"""""""""""""""""""""""""""""""""""""""""""""""""""""

"""""""""""""""DoxygenToolkit配置""""""""""""""""""
let g:DoxygenToolkit_authorName="enic errorcpp@qq.com" 
""""""""""""""""""""""""""""""""""""""""""""""""""


